home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 15.dir / 00110_Text_text07.txt < prev    next >
Text File  |  2000-10-01  |  2KB  |  12 lines

  1. To set up this chain reaction, weΓÇÖre going to have a new looping script that will live inside the Menu Item movie clip, a Chain Script:
  2.  
  3. Previousclip = "/" add (getProperty ("../",_name)-1);
  4.  setProperty ("../", _x, (getProperty("../",_x))+(getProperty(PreviousClip,_x)-getProperty ("../",_x))/2))+5);
  5.  set Property ("../", _y, (getProperty("../",_y))+(getProperty(PreviousClip,_y)-getProperty ("../",_y))/2))+5);
  6. The first line sets a variable, called PreviousClip, to the name of the parent movie clip, minus 1. So if I was to be sitting inside a movie clip with the instance name 5, the name of my parent movie clip minus 1 would equal 4. The forward slash at the beginning of (getProperty ("../",_name)-1) is the path for the main timeline, where PreviousClip will be. So, if IΓÇÖm sitting inside the movie clip 5, my PreviousClip would equal /4.
  7. The second line says, "Set the x position of my parent clip to move to half the distance from itself to its previous clip. Then add 10." If we didnΓÇÖt add 10 to the end, each menu item would move over the top of its previous clip, causing all of our menu items to sit directly on top of each other and, of course, we want them to cascade.
  8.  
  9. The third line contains the instruction to repeat the same script for the parent clipΓÇÖs y position, saying "Set the y position of my parent clip to move half the distance from itself to its previous clip. Then add 10."
  10.  
  11. Our 0 movie clip (the drag menu tab) is simply going to be a graphic with an overlaid button that has a drag action on it, just like Useless fun Drag.
  12. So, now, when the movie is started, it will build itself, spawning menu items to random locations. Each menu item will glide towards its previous clip, and the menu will settle into an evenly spaced cascade of items. When the user drags the drag tab 0, the menu will follow in a dynamic flowing chain reaction.